﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CommonHeader.aspx.cs" Inherits="CommonHeader" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>上框架公司Logo</title>
    <script type="text/javascript">
        // 防止从首页点击进入框架页面，再点击返回按钮出现框架嵌套问题
        if (this.parent.window != this.top) {
            this.top.location.href = this.parent.window.location.href;
        }

        function ReloadSession() {

            XmlPost("Modules/Basic/Common/UserOnLine/UserOnLine.aspx");
            // 每100秒钟刷新一次
            // alert("ReloadSession");
            setTimeout("ReloadSession()", 1000 * 100);
        }

        ReloadSession();

        // 打开登录窗口
        function openShowModal() {
            this.top.location.href = "LogOn.aspx";
            /*
            var urlpath = "OpenLogOn.aspx?temp=" + new Date().toString();
            var Query = "center: Yes; help: Yes; resizable: No; status: no;scroll:no; dialogHeight :240px; dialogWidth:320px;";

            var tmp = window.showModalDialog(urlpath, window, Query);

            if (tmp == "1") {
            alert("登录成功，欢迎使用本系统。");
            }

            //无论是否登录,均重新刷新
            SetUserLogOnInfo();
            */
        }

        // 以XML求取数据
        //webFileUrl:要读取的页面地址,可带参数
        function XmlPost(webFileUrl) {
            try {
                // alert(webFileUrl);
                var result = "";
                var xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
                xmlHttp.open("POST", webFileUrl, false);
                xmlHttp.send("");
                result = xmlHttp.responseText;
                // alert(result);
                return (result);
            }
            catch (e) {
                return ("脚本错误,未取到正确数据!");
            }
        }

        // 加载事件
        function initIconEvent() {
            var tmpElements = document.getElementsByTagName('DIV');
            for (var i = 0; i < tmpElements.length; i++) {
                var tmpElement = tmpElements[i];
                var tmpElementId = tmpElement.id;
                // 快捷菜单鼠标移入移出效果
                if (tmpElement.tagoc == "divicon") {

                    tmpElement.onmouseover = function () {
                        this.className = "diviconover";
                    }
                    tmpElement.onmouseout = function () {
                        this.className = "divicon";
                    }
                }
                switch (tmpElementId) {
                    case "dividindex":
                        // 打开主页
                        tmpElement.onclick = function () {
                            parent.fraContent.location.href = "MainForm.aspx";
                        }
                        break;
                    case "dividexit":
                        // 安全退出
                        tmpElement.onclick = function () {
                            parent.location.href = "Logouting.aspx";
                        }
                        break;
                    case "dividsms":
                        // 内部消息
                        tmpElement.onclick = function () {
                            if (parent.fraContent.document.getElementById('onlinesms') != null) {
                                var objDivID = document.getElementById('unreadsms');
                                parent.fraContent.document.getElementById('onlinesms').click();
                            }
                            else {
                                alert("此页不支持消息窗口！");

                            }
                        }
                        break;
                    case "dividemail":
                        // 内部邮件
                        tmpElement.onclick = function () {
                            parent.fraContent.location.href = "a.aspx";
                        }
                        break;
                    case "dividnews":
                        // 新闻
                        tmpElement.onclick = function () {
                            parent.fraContent.location.href = "/general/news/show/";
                        }
                        break;
                    case "dividnotify":
                        // 公告
                        tmpElement.onclick = function () {
                            parent.fraContent.location.href = "/general/notify/show/index.php";
                        }
                        break;
                    case "dividforward":
                        // 前进
                        tmpElement.onclick = function () {
                       
                            history.go(1);
                        }
                        break;
                    case "dividback":
                        // 后退
                        tmpElement.onclick = function () {
                            // 获取是否有加载效果
                            var isload = '<%= IsLoading %>';
                            // 判断是否有加载效果
                            if (isload) {
                                history.go(-2);
                            }
                            else {
                                history.go(-1);
                            }
                        }
                        break;
                    case "dividrefresh":
                        // 刷新
                        tmpElement.onclick = function () {
                            parent.fraContent.location.reload();
                        }
                        break;
                    case "dividcalendar":
                        // 日程
                        tmpElement.onclick = function () {
                            parent.fraContent.location.href = "/general/calendar/index.php";
                        }
                        break;
                    case "dividsetting":
                        // 设置
                        tmpElement.onclick = function () {
                            parent.fraContent.location.href = "/general/ipanel/shortcut/mymenu_define/index.php";
                        }
                        break;
                    case "dividcontact":
                        tmpElement.onclick = function () {
                            parent.window.open('http://webchat.tq.cn/sendmain.jsp?uin=8038959&agentid=0&transferpage=1&tq_bottom_ad_url=http://qtt.tq.cn/post/sendmain.html&tq_right_infocard_url=http://qtt.tq.cn/showcard.do&page=&ispaymoney=1&buttonsflag=&iscallback=0&rand=8323811151122', 1, 'width=430,height=405,location=no,resizable=0,scrollbars=0,status=no,toolbar=no,menu=no,top=100,left=200');
                        }
                        break;
                    case "dividhelp":
                        // 帮助中心
                        tmpElement.onclick = function () {
                            parent.window.open('/helppage/help.php', null, 'width=580,height=290,location=no,resizable=1,scrollbars=1,status=no,toolbar=no,menu=no,top=100,left=300');
                        }
                        break;
                    case "dividmemopen":
                        // 便签
                        tmpElement.onclick = function () {
                            if (parent.fraContent.document.getElementById('memopen') != null) {
                                parent.fraContent.document.getElementById('memopen').click();
                            }
                            else {
                                alert("此页不支持消息窗口！");

                            }
                        }
                        break;
                }
            }

        }
        function tick() {
            var hours, minutes, seconds, xfile;
            var intHours, intMinutes, intSeconds;
            var today, theday;
            today = new Date();
            function initArray() {
                this.length = initArray.arguments.length
                for (var i = 0; i < this.length; i++)
                    this[i + 1] = initArray.arguments[i]
            }
            var d = new initArray(
       " 星期日",
       " 星期一",
       " 星期二",
       " 星期三",
       " 星期四",
       " 星期五",
       " 星期六");
            theday = today.getYear() + "年" + [today.getMonth() + 1] + "月" + today.getDate() + "日" + d[today.getDay() + 1];
            intHours = today.getHours();
            intMinutes = today.getMinutes();
            intSeconds = today.getSeconds();
            if (intHours == 0) {
                hours = "12:";
                xfile = " 午夜 ";
            } else if (intHours < 12) {
                hours = intHours + ":";
                xfile = " 上午 ";
            } else if (intHours == 12) {
                hours = "12:";
                xfile = " 正午 ";
            } else {
                intHours = intHours - 12
                hours = intHours + ":";
                xfile = " 下午 ";
            }
            if (intMinutes < 10) {
                minutes = "0" + intMinutes + ":";
            } else {
                minutes = intMinutes + ":";
            }
            if (intSeconds < 10) {
                seconds = "0" + intSeconds + " ";
            } else {
                seconds = intSeconds + " ";
            }
            timeString = theday + xfile + hours + minutes + seconds;
            Clock.innerHTML = timeString;
            window.setTimeout("tick();", 100);
        }
        window.onload = tick;
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <!--公司logo主体布局开始-->
    <div class="head">
        <!-- 公司logo图标开始 -->
        <div class="headlogo">
        </div>
        <!-- 公司logo图标结束-->
        <div class="headinfo">
            <!-- 系统及个人信息显示开始-->
            <div class="headinfotop">
                <!-- 当前时间开始-->
                <div id="Clock" class="headinfotopdate">
                </div>
                <!-- 当前时间结束-->
                <!-- 系统用户显示开始-->
                <div class="headinfotopinfo">
                    <%=  this.UserInfo.RealName + " ( " + this.UserInfo.RoleName + " " + this.UserInfo.CompanyName + " " + this.UserInfo.DepartmentName + " ) , " + this.ToolButtonWelcomeUseSystem %></div>
                <!-- 系统用户显示结束-->
            </div>
            <!-- 系统及个人信息显示结束-->
            <!-- 快捷菜单开始-->
            <div class="headinfobottom">
                <table cellpadding="2" border="0px" style="margin-top: 10px; margin-right:5px;  ">
                    <tr>
                        <td nowrap="false" id="div_1">
                            <div class="divicon" id="dividfavorite" title="<%=this.ToolButtonFavorite %>">
                                <span class='favorite'>
                                    <%=this.ToolButtonFavorite %></span>
                            </div>
                        </td>
                        <td nowrap="false" id="div_2">
                            <div tagoc="divicon" class="divicon" id="dividsms" title="<%=this.ToolButtonSms %>">
                                <img style="display: " align="absmiddle" src="Images/Common/head/sms.gif">
                                <span style="display: none">
                                    <%=this.ToolButtonSms%></span><span class="unread" id="unreadsms"></span></div>
                        </td>
                        <td nowrap="false" id="div_3">
                            <div tagoc="divicon" class="divicon" id="dividmemopen" title="<%=this.ToolButtonMemopen %>">
                                <img style="display: " align="absmiddle" src="Images/Common/head/memopen.gif">
                                <span style="display: none">
                                    <%=this.ToolButtonMemopen %></span></div>
                        </td>
                        <td nowrap="false" id="div_4">
                            <div tagoc="divicon" class="divicon" id="dividindex" title="<%=this.ToolButtonIndex %>">
                                <img style="display: " align="absmiddle" src="Images/Common/head/index.gif">
                                <span style="display: none">
                                    <%=this.ToolButtonIndex %></span></div>
                        </td>
                        <td nowrap="false" id="div_5">
                            <div tagoc="divicon" class="divicon" id="dividsetting" title="<%=this.ToolButtonSetting %>">
                                <img style="display: " align="absmiddle" src="Images/Common/head/setting.gif">
                                <span style="display: none">
                                    <%=this.ToolButtonSetting %></span></div>
                        </td>
                        <td nowrap="false" id="div_6">
                            <div tagoc="divicon" class="divicon" id="dividforward" title="<%=this.ToolButtonForward%>">
                                <img style="display: " align="absmiddle" src="Images/Common/head/forward.gif">
                                <span style="display: none">
                                    <%=this.ToolButtonForward %></span></div>
                        </td>
                        <td nowrap="false" id="div_7">
                            <div tagoc="divicon" class="divicon" id="dividback" title="<%=this.ToolButtonBack%>">
                                <img style="display: " align="absmiddle" src="Images/Common/head/back.gif">
                                <span style="display: none">
                                    <%=this.ToolButtonBack %></span></div>
                        </td>
                        <td nowrap="false" id="div_8">
                            <div tagoc="divicon" class="divicon" id="dividrefresh" title="<%=this.ToolButtonRefresh%>">
                                <img style="display: " align="absmiddle" src="Images/Common/head/refresh.gif">
                                <span style="display: none">
                                    <%=this.ToolButtonRefresh %></span></div>
                        </td>
                        <td nowrap="false" id="div_9">
                            <div tagoc="divicon" class="divicon" id="dividnews" title="<%=this.ToolButtonNews%>">
                                <img name="img" style="display: " align="absmiddle" src="Images/Common/head/news.gif">
                                <span style="display: none">
                                    <%=this.ToolButtonNews %></span></div>
                        </td>
                        <td nowrap="false" id="div_10">
                            <div tagoc="divicon" class="divicon" id="dividnotify" title="<%=this.ToolButtonNotify%>">
                                <img style="display: " align="absmiddle" src="Images/Common/head/notify.gif">
                                <span style="display: none">
                                    <%=this.ToolButtonNotify %></span></div>
                        </td>
                        <td nowrap="false" id="div_11">
                            <div tagoc="divicon" class="divicon" id="dividcalendar" title="<%=this.ToolButtonCalendar%>">
                                <img style="display: " align="absmiddle" src="Images/Common/head/calendar.gif">
                                <span style="display: none">
                                    <%=this.ToolButtonCalendar %></span></div>
                        </td>
                        <td nowrap="false" id="div_12">
                            <div tagoc="divicon" class="divicon" id="dividemail" title="<%=this.ToolButtonEmail%>">
                                <img style="display: " align="absmiddle" src="Images/Common/head/email.gif">
                                <span style="display: none">
                                    <%=this.ToolButtonEmail %></span><span class="unread" id="unreademail"></span></div>
                        </td>
                        <td nowrap="false" id="div_13">
                            <div tagoc="divicon" class="divicon" id="dividhelp" title="<%=this.ToolButtonHelp%>">
                                <img style="display: " align="absmiddle" src="Images/Common/head/help.gif">
                                <span style="display: none">
                                    <%=this.ToolButtonHelp %></span></div>
                        </td>
                        <td nowrap="false" id="div_14">
                            <div tagoc="divicon" class="divicon" id="dividexit" title="<%=this.ToolButtonExit%>">
                                <img style="display: " align="absmiddle" src="Images/Common/head/exit.gif">
                                <span style="display: none">
                                    <%=this.ToolButtonExit%></span></div>
                        </td>
                    </tr>
                </table>
            </div>
            <!-- 快捷菜单结束-->
        </div>
    </div>
    <!-- 公司logo主体布局结束-->
    <!-- 执行鼠标移入效果 -->
    <script type="text/javascript">
        initIconEvent();
    </script>
    </form>
</body>
</html>
